#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <stdlib.h>


int ch[101];
int in[101];

int com(const void* x, const void* y)
{
	return *(int*)x - *(int*)y;
}


int main()
{
	int count = 1;
	int n;
	int k = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &ch[i]);

	}
	in[0]= ch[0];
	is:
	for (int i = 1; i < n; i++)
	{
		k = 0;
		while (1)
		{
			if (ch[i] == in[k])
			{
				i++;
				goto is;
			}
			else
			{
				for (int l = 0; l < i; i++)
				{

				}
				in[count] = ch[i];
				count++;
				continue;
			}
		}
	}




	printf("%d\n", count);
	qsort(in, count, sizeof(int), com);
	for (int j = 0; j < count; j++)
	{
		printf("%d ", &in[j]);
	}
	return 0;
}